from rest_framework import serializers
from live.models import Channel

class ChannelSerializer(serializers.ModelSerializer):
    """
    直播管理
    """
    name = serializers.CharField(required=True, error_messages={
        "error_code": "40001",
        "error_msg": "直播名必填"
    })

    channel_passwd = serializers.CharField(required=True, error_messages={
        "error_code": "40001",
        "error_msg": "直播密码必填"
    })

    class Meta:
        model = Channel
        fields = '__all__'


